<template>
    <div>
        <div>
            <div class="top">
                <span class="btn" @click="getInto">&lt;</span>
                <span class="nav">砍价列表</span>
            </div>
            <div class="bargaining" v-for="(item,index) in bargaining" :key="index"
                v-show="item.id >=57951&&item.id <=99764" @click="onClick(item)">
                <div class="left">
                    <img :src="item.pic" alt="">
                </div>
                <div class="right">
                    <div class="right-top">
                        <p class="name">{{item.name}}</p>
                        <p class="jieshao">{{item.characteristic}}</p>
                    </div>
                    <div class="right-buttom">
                        <p><span class="span">￥{{item.minPrice}}</span><br>低价</p>
                        <p><span>￥{{item.kanjiaPrice}}</span><br>原价</p>
                        <p><span>{{item.originalPrice}}件</span><br>限量</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
  import {mapState} from "vuex"
    export default {
        computed: {
        ...mapState({
            bargaining:state=>state.homeSwiper.bargainingList
        })
    },
        methods:{
            getInto(){
                this.$router.push({
                    path:'/'
                })
            },
            onClick(item) {
                this.$router.push({
                    path: '/recommend-shopping-xiang',
                    query: {
                        item: item
                        
                    }
                })
            }
        }
    }
</script>

<style lang='scss' scoped>
    .top {
        width: 100%;
        height: 1rem;
        line-height: 1rem;
        font-size: 0.4rem;

        span {
            display: inline-block;
        }

        .btn {
            width: 1rem;
            height: 1rem;
            text-align: center;
        }

        .nav {
            margin-left: 2rem;
        }
    }
    .bargaining{
    width: 100%;
    display: flex;
    .left{
        width: 33%;
        height: 2.5rem;
        padding: 0.1rem;
        img{
            width: 100%;
            height:100%;
        }
    }
    .right{
        width: 70%;
        padding: 0.1rem;
        .right-top{
            font-size: 0.34rem;
        }
        .jieshao{
            font-size: 0.28rem;
            color: gray;
        }
        .right-buttom{
            width: 100%;
            display: flex;
            font-size: 0.34rem;
            margin-top: 0.3rem;
            .span{
                color: red;
            }
            p{
                width: 1.5rem;
                text-align: center;
                color: gray;
            }
        }
    }
}
</style>